﻿using System;
class DigitSevenCheck
{
    static void Main()
    {
        int testnumber=0;
        int stringlenght;
        string convertednumber;
        Console.Write("Input Number: ");
        do
        {
            if (testnumber != 0)
            {
                Console.Write("Please re-enter number with min 3 digits: ");
            }
            while (true)
            {
                try
                {
                    testnumber = int.Parse(Console.ReadLine());
                    break;
                }
                catch (Exception ex)
                {
                    Console.Write(ex.Message + "\nPlease re-enter number:");
                }
            }
            convertednumber = (testnumber.ToString());
            stringlenght = convertednumber.Length;
        } while (stringlenght < 3);
            if (convertednumber[stringlenght - 3] == '7')
            {
                Console.WriteLine("IT IS 7 !!!");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("IT IS NOT 7");
                Console.ReadLine();
            }
    }
}
